//
//  CallNameView.m
//  ConghuiEducation
//
//  Created by leo on 16/8/31.
//  Copyright © 2016年 sample. All rights reserved.
//

#import "CallNameView.h"

@implementation CallNameView
@synthesize numberLabel;
@synthesize numberColorbgView;
@synthesize nameLabel;
@synthesize avatarImageView;
@synthesize actionButton;
@synthesize verticalLine;


-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        [self setBackgroundColor:[UIColor lightGrayColor]];
        
        self.numberColorbgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
        [numberColorbgView setImage:[UIImage imageNamed:@"numbg.png"]];
        [self addSubview:numberColorbgView];
        
        self.numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
        [numberLabel setFont:[UIFont systemFontOfSize:18]];
        [numberLabel setBackgroundColor:[UIColor clearColor]];
        [numberLabel setTextColor:[UIColor whiteColor]];
        [numberLabel setTextAlignment:NSTextAlignmentCenter];
        [numberColorbgView addSubview:numberLabel];
        [numberLabel setText:@"18"];
        
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 100/2-50/2-5, KScreenWidth/3-50, 50)];
        [nameLabel setBackgroundColor:[UIColor clearColor]];
        [nameLabel setFont:[UIFont systemFontOfSize:23]];
        [nameLabel setText:@"李文浩"];
        [self addSubview:nameLabel];
        
        self.avatarImageView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 100/2-15-5, 30, 30)];
        [avatarImageView setImage:[UIImage imageNamed:@"avatar.png"]];
        [avatarImageView.layer setCornerRadius:avatarImageView.frame.size.width/2.0];
        [avatarImageView.layer setMasksToBounds:YES];
        [self addSubview:avatarImageView];
        
        self.actionButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [actionButton setFrame:CGRectMake(frame.size.width-70,100/2-40/2-5, 70, 40)];
        [actionButton setTitle:@"接到" forState:UIControlStateNormal];
        [self addSubview:actionButton];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
